1. Field of the Invention
The present invention relates to an apparatus and a method for generating random numbers.
2. Description of the Related Art
Conventional random-number generators are arranged to generate random numbers ranging from "000 . . . 000" to "111 . . . 111". For example, an 8-bit random-number generator generates numerical values ranging from "00000000" to "11111111". If the position to the left of the most significant bit of these numerical values is the position of a decimal point, then the random-number generator generates numerical values from "0" to "0.999 . . . " according to the decimal notation, i.e., numerical values from not less than "0" to less than "1". These random numbers will hereinafter be referred to as "random numbers of the amplitude 1.
FIG. 8 of the accompanying drawings shows a polynomial counter which is widely used as a random-number circuit. For the sake of brevity, the illustrated polynomial counter is of a 4-bit configuration, i.e., comprises four cascaded D-type flip-flops. As shown in the timing chart of FIG. 9 of the accompanying drawings, a 4-bit random number of R3, R2, R1, R0 produced by the polynomial counter is successively updated in synchronization with a rise of a clock signal CK, so that the polynomial counter generates random numbers ranging from "0000" to "1110". The polynomial counter does not generate a random number "1111" because it is prohibited due to circuit limitations of the polynomial counter, but not because the polynomial counter is intentionally arranged not to generate the random number "1111". The polynomial counter generates all combinations of 0, 1, one at a time, except for "1111", and is then returned to a state immediately after it is reset. Generally, random-number generators are arranged to generate all combinations of 0, 1, i.e., to generate random numbers of the amplitude 1.
Actual random-number applications may not always necessarily require random numbers of the amplitude 1. In this connection, an example of dither in an audio signal processing application will be described below. Dithering is the application of small-amplitude noise to a small-amplitude signal so as to prevent the small-amplitude signal from being converted into noise by quantization. As shown in FIG. 10(a) of the accompanying drawings, when a weak signal that varies in an amplitude comparable to the amplitude of a least significant bit (LSB) is quantized, the quantized signal suffers changes greater than the changes in the original signal. To avoid this drawback, dither or an oscillation is applied to the original signal, and the resultant signal is quantized. Even when the original signal changes in an amplitude less than the amplitude of one bit, the quantized signal changes its sign, thereby improving the audible perception of the reproduced signal. As can be seen from the purpose of dithering, the dither signal has an amplitude which is smaller than the amplitude of one bit. White noise, i.e., random numbers, is used as dither so that noise added as dither will not be perceived as certain sound.
One specific example which employs dithering is a Dolby-AC-3 system, which is a highly efficient audio signal coding system, and the system processes an audio signal by dividing it into a mantissa and an exponent. When the number of bits allocated to the mantissa is 0 (zero), a random number is used as dither instead of 0. At that time, random numbers ranging from +0.707 to -0.707 are used as dither. For more detail, reference should be made to United States Advanced Television Systems Committee "Digital Audio Compression (AC-3) ATSC STANDARD" Doc. AC/52 Nov. 10, 1994, pp. 66. Therefore, random numbers having an amplitude of 0.707 (square root of 1/2) are needed. Since it is known that it has heretofore been difficult to generate random numbers having an amplitude of 0.707, the above document suggests that random numbers having a more easily achievable amplitude of 0.75 or 0.5 be used instead of random numbers having an amplitude of 0.707.
Conventional processes of generating ideal random numbers having an amplitude of 0.707 and substitute random numbers having amplitudes of 0.75 and 0.5 will be described below.
To generate a random number having an amplitude of 0.707, as shown in FIG. 1 of the accompanying drawings, a random number having an amplitude 1, which is generated by a first random-number generator 101, and a constant of 0.707 generated by a constant generator 102 are supplied to a multiplier 103, which multiplies the random number by the constant 0.707, thereby generating a random number having an amplitude of 0.707. This process can produce random numbers having an ideal amplitude, but requires the multiplier 103 and hence a large overall circuit scale.
To generate a random number having an amplitude of 0.75, as shown in FIG. 2 of the accompanying drawings, a random number having an amplitude 1, which is generated by a first random-number generator 201, is shifted one bit and two bits to the right by respective shifters 202, 203, and then added to each other by an adder 204, thereby generating a random number having an amplitude of 0.75. The generated amplitude of 0.75 has an error of about 6% with respect to the ideal amplitude of 0.707. This process also needs a relative large overall circuit scale because of the need for the adder 204, though the overall circuit scale is smaller than the overall circuit scale shown in FIG. 1.
To generate a random number having an amplitude of 0.5, as shown in FIG. 3 of the accompanying drawings, a random number having an amplitude 1, which is generated by a first random-number generator 301, is shifted one bit to the right by a shifter 302, thereby generating a random number having an amplitude of 0.5. The generated amplitude of 0.5 has an error of about 30% with respect to the ideal amplitude of 0.707. This process needs a relatively small overall circuit scale.
As described above, it has been customary to combine a random-number generator for generating a random number having an amplitude 1 and a circuit or circuits for varying the amplitude of a random number are combined with each other to produce a random number having an amplitude other than the amplitude 1. The overall scale of a required circuit arrangement and the size of an amplitude error are inversely proportional to each other, and cannot be improved at the same time.
With the conventional random-number generating apparatus, therefore, a random number having an amplitude 1 is generated at first and then processed into a random number having a desired amplitude. A relatively large-size processing circuit is required to achieve a desired amplitude with high accuracy. If a smaller-scale processing circuit were employed, then a produced amplitude would suffer a larger error. Conventional random-number generating apparatus has been unable to provide a random-number generating apparatus which is relatively small in circuit scale and capable of generating random numbers of a highly accurate amplitude.